<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
    
<%
    String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>    
<!doctype html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
    <link rel="stylesheet" href="<%=path%>/css/manager/login.css">
    <script type="text/javascript" src="<%=path%>/js/manager/jquery-1.8.2.js"></script>
    <!--  <script type="text/javascript" src="<%=path%>/js/Regular.js"></script>-->
	<title>后台登陆</title>	
	<script type="text/javascript">
	 
		//登录验证
		function validate(){ 
			var select =$("#userType").val();
			if(select==1){
				//验证用户名
				var username=$("#username").val();
				if(username.length==""){
					$("#msg").html("");
			    	$("#msg").html("用户名不能为空");
			    	return false;
				}
				var password=$("#pwd").val();
				if(password.length==""){
					$("#msg").html("");
			    	$("#msg").html("密码不能为空");
			    	return false;
				}else if(password.length<6 || password.length>12){
			    	 $("#msg").html("");
			    	 $("#msg").html("请输入6-12位字符密码");
			    	 return false;
			    } 
				return true;
			}
		}
		
		function myclear(){
		 $("#msg").html("");
		}
		function changeImg(){     
		    var imgSrc = $("#imgObj");     
		    var src = imgSrc.attr("src");     
		    imgSrc.attr("src",chgUrl(src)); 
		    $("#userType").val("0");
		    $("#sform").submit();
		}     
		//时间戳     
		//为了使每次生成图片不一致，即不让浏览器读缓存，所以需要加上时间戳     
		function chgUrl(url){     
		    var timestamp = (new Date()).valueOf();     
		    urlurl = url.substring(0,17);     
		    if((url.indexOf("&")>=0)){     
		        urlurl = url + "×tamp=" + timestamp;     
		    }else{     
		        urlurl = url + "?timestamp=" + timestamp;     
		    }
		   
		    return url;     
		}     

		function callback(data){     
		    $("#info").html(data);     
		}  
	</script>
	
</head>
<body>
		<!--
        	作者：offline
        	时间：2016-12-20
        	描述：登录
        -->
		<div class="login_div1">
			<form action="<%=path%>/login/backlogin.htm" method="post"  id="sform" name="sform">
				<input type="hidden" id="userType" name="userType" value="1">
			<div class="login_div1_div1">
				<img src="<%=path%>/images/manager/logos_02.png" />
			</div>
			<div class="login_div1_div4" id="msg">${msg}</div>
			<input type="text" class="login_div1_in1" placeholder="用户名"  name="sysuserName" id="username" value="${user.sysuserName}"/>
			<input type="password" class="login_div1_in2" placeholder="password"  name="sysuserPwd" id="pwd" onclick="myclear()" value="${user.sysuserPwd}" />
			<div class="login_div1_div2">
				<input class="login_div1_div2_in1" type="text" name="validateCode" id="validateCode" class="yanzheng"/>
				<img id="imgObj" class="login_div1_div2_img1" src="<%=path%>/xuan/verifyCode.htm"  onclick="changeImg()"/>
			</div>
			<input type="submit" class="login_div1_in3" value="Login"  onclick="return validate()" />
			<div class="login_div1_div3">Web app framework base on Bootstrap and AngularJS©2014</div>
			</form>
		</div>
		
</body>
</html>
 